function Analyze_p()
    clear all;clc;cd('./');format compact;format short g;close all hidden;

% % % %  Paras = [ r mu sigma rho gamma x0 I p  eta1 eta2 lambda T];;
    ip=9;
    dana=1;
    p=10:dana:19;
    ana=p;
    

    n=length(ana);
   Paras = Parameters;
    
       Fxis=zeros(n,1);
    Fxip=zeros(n,1);
    Fphig=zeros(n,1);
    FCs=zeros(n,1);
    FCp=zeros(n,1);
    FFp=zeros(n,1);
    FFs=zeros(n,1);
    
    Exi0=zeros(n,1);
    Exi1=zeros(n,1);
    Exis=zeros(n,1);
    Exim=zeros(n,1);
    Exip0=zeros(n,1);
    Exip1=zeros(n,1);
    Exip=zeros(n,1);
    Ephi0=zeros(n,1);
    Ephi1=zeros(n,1);
    Ephis=zeros(n,1);
    Ephip0=zeros(n,1);
    Ephip1=zeros(n,1);
    Ephig=zeros(n,1);
    ECs=zeros(n,1);
    ECp=zeros(n,1);
    EFp=zeros(n,1);
    EFs=zeros(n,1);
    
    
 
    for i=1:n
        Paras(ip)=ana(i);
         [Fxis(i),Fxip(i),Fphig(i),FCs(i),FCp(i),FFp(i),FFs(i)]=Solve_model_F(Paras);   
         [Exi0(i),Exi1(i),Exis(i),Exim(i),Exip0(i),Exip1(i),Exip(i),Ephi0(i),Ephi1(i),Ephis(i),Ephip0(i),Ephip1(i),Ephig(i),ECs(i),ECp(i),EFp(i),EFs(i)]=Solve_model_E(Paras);    
    end 
  %______________________________
  %______________________________

  
 
  
  
  
  
%          figure
%     plot(p,Fxis,'-',p,Exis,'-*','linewidth',3);
%     xlabel('Funding gap','Fontsize',16,'Fontname', 'Times');
%     ylabel('Investment threshold','Fontsize',16,'Fontname', 'Times');
%     hg = legend('Separating with FGS','Separating with EGS',0); optex={'fontsize', 16, 'fontname', 'Times','Interpreter','tex'};  set(hg, optex{:});
%    % xlim([x(1),x(length(x))]);
%     saveas(gcf,'FEinvestmentseP','epsc');
%     saveas(gcf,'FEinvestmentseP','png');
%  
  
  
     figure
    plot(p,FCs,'-p',p,FCp,'-*b',p,ECs,'--k',p,ECp,'-sr','linewidth',3);
    xlabel('Funding gap','Fontsize',16,'Fontname', 'Times');
    ylabel('Cost of adverse selection','Fontsize',16,'Fontname', 'Times');
    hg = legend('SE with FGS','PE with FGS','SE with EGS','PE with EGS',0); optex={'fontsize', 16, 'fontname', 'Times','Interpreter','tex'};  set(hg, optex{:});
    saveas(gcf,'11-1','epsc');
    saveas(gcf,'11-1','png');  
          
%    
%         figure
%     plot(p,Fxip,'-',p,Exip,'-*','linewidth',3);
%     xlabel('Funding gap','Fontsize',16,'Fontname', 'Times');
%     ylabel('Investment threshold','Fontsize',16,'Fontname', 'Times');
%     hg = legend('Dynamic pooling equilibrium with FGS','Dynamic pooling equilibrium with EGS',0); optex={'fontsize', 16, 'fontname', 'Times','Interpreter','tex'};  set(hg, optex{:});
%     saveas(gcf,'FEinvestmentpP','epsc');
%     saveas(gcf,'FEinvestmentpP','png'); 
 
%     figure
%     plot(P,Cs,'-',P,Cp,'--',P,bCp,'-*','linewidth',3);
%     xlabel('Funding gap','Fontsize',16,'Fontname', 'Times');
%     ylabel('Cost','Fontsize',16,'Fontname', 'Times');
%    hg = legend('Separating','Non-dynamic pooling','Dynamic pooling',0); optex={'fontsize', 16, 'fontname', 'Times','Interpreter','tex'};  set(hg, optex{:});
%     saveas(gcf,'lcostP','epsc');
%     saveas(gcf,'lcostP','png'); 
%     
    
    
end